package com.wondertek.poms.dao.repo;

import com.wondertek.poms.dao.po.BcInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chenjijiang
 * @description
 */
@Repository
public interface IBcInfoDao extends JpaRepository<BcInfo, Long>, JpaSpecificationExecutor<BcInfo> {
	@Query(value = "select * from BC_INFO  where USER_ID=?1 and USER_TYPE=0", nativeQuery = true)
	BcInfo findByUserId(Long userId);

	@Query(value = "select * from BC_INFO where USER_ID in (?1) and USER_TYPE=1 ", nativeQuery = true)
	List<BcInfo> findAllByGroups(String groups);

}
